Algebras for Weighted Search